package gstudio;

import org.eclipse.ui.IFolderLayout;
import org.eclipse.ui.IPageLayout;
import org.eclipse.ui.IPerspectiveFactory;

public class Perspective implements IPerspectiveFactory {

	public void createInitialLayout(IPageLayout layout) {
		/*
		 * Beispiel
		 */
		// layout.getViewLayout("GSID.view.mp3").setCloseable(false);// 视图关闭按钮隐藏
		// layout.addView("GSID.view.mp3", 0, 0, editorArea);

		/*
		 * Beispiel
		 */
		// IWorkbenchWindow中的getActivePage().showView方法 会调用 plan
		// 但是快速view只是在靠左的地方
		// IFolderLayout folder=layout.createFolder("right", IPageLayout.BOTTOM,
		// 0.33f, editorArea);
		// folder.addPlaceholder("GSID.view.plan"+":*");
		// folder.addView("GSID.view.plan");//启动就显示
		// //folder.addPlaceholder("GSID.view.mp3"+":*");
		// folder.addView("GSID.view.mp3");//启动就显示

		/*
		 * Beispiel : 相比上面，这里就不需要Folder
		 */
		// layout.addStandaloneViewPlaceholder("GSID.view.plan",IPageLayout.BOTTOM,0.25f,editorArea,true);

		/*
		 * Beispiel
		 */
		// layout.setEditorAreaVisible(false);
		// layout.setFixed(true);

		/*
		 * Beispiel: 会在最下面的菜单出现图标，打开都是靠左
		 */
		// layout.addFastView("GSID.view.artikel");
		// layout.addFastView("GSID.view.wort");
		// layout.addFastView("GSID.view.plan");

		String editorArea = layout.getEditorArea();
		layout.addView("GSID.view.artikelindex", IPageLayout.LEFT, 0.2f,
				editorArea);
		layout.getViewLayout("GSID.view.artikelindex").setCloseable(false);

		layout.addView("GSID.view.artikel", IPageLayout.LEFT, 0.8f, editorArea);
		layout.getViewLayout("GSID.view.artikel").setCloseable(false);
		IFolderLayout folder = layout.createFolder("right", IPageLayout.BOTTOM,
				0.33f, editorArea);
		folder.addPlaceholder("GSID.view.artikel.satz" + ":*");
		folder.addView("GSID.view.artikel.satz");// 启动就显示
		layout.getViewLayout("GSID.view.artikel.satz").setCloseable(false);

		folder.addPlaceholder("GSID.view.artikel.wort" + ":*");
		folder.addView("GSID.view.artikel.wort");// 启动就显示
		layout.getViewLayout("GSID.view.artikel.wort").setCloseable(false);

		// layout.addView("GSID.view.wort", IPageLayout.BOTTOM, 0.9f,
		// "GSID.view.artikel");
		// layout.getViewLayout("GSID.view.wort").setCloseable(false);
		//
		// layout.addShowViewShortcut("GSID.view.mp3");
		// layout.getViewLayout("GSID.view.mp3").setCloseable(false);

		layout.setEditorAreaVisible(false); 
		System.out.println("load Perspective");

	}
}
